pub mod materials;
pub mod users;
pub mod projects;
pub mod providers;
pub mod contracts;
pub mod payments;
pub mod  invoice;
pub mod imports;

#[derive(Debug, serde::Serialize)]
pub struct ResultInfo<T> {
    pub status: i32,
    pub data: Option<T>,
    pub message: Option<String>,
}

#[derive(Debug, Clone, serde::Serialize)]
pub struct Page<T> {
    content: Vec<T>,
    total: i64,
}

// impl<'r> FromRequest<'r> for ApiKey<'r> {
//     type Error = ApiKeyError;

//     async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
//         /// Returns true if `key` is a valid API key string.
//         fn is_valid(key: &str) -> bool {
//             key == "valid_api_key"
//         }

//         match req.headers().get_one("x-api-key") {
//             None => Outcome::Error((Status::Unauthorized, ApiKeyError::Missing)),
//             Some(key) if is_valid(key) => Outcome::Success(ApiKey(key)),
//             Some(_) => Outcome::Error((Status::Unauthorized, ApiKeyError::Invalid)),
//         }
//     }
// }
